<!DOCTYPE html >
<html>
<head>
<meta name="Generator" content="TPshop v1.1" />
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<title>众创织梦投诉建议</title>
<meta http-equiv="keywords" content="{$tpshop_config['shop_info_store_keyword']}" />
<meta name="description" content="{$tpshop_config['shop_info_store_desc']}" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<link rel="stylesheet" type="text/css" href="__STATIC__/css/index.css"/>
<link rel="stylesheet" href="/Public/layui/css/layui.css"/>
<script type="text/javascript" src="/Public/layui/layui.js"></script>
<style type="text/css"> 
	.layui-form-label{width: 50px;}
	.layui-form-item .layui-inline{clear: none;float: left;margin:0;}
	.entry-list ul{width:auto;}
	#pingfen span{float: right;margin: 12px;font-size:18px;color:#009688;}
	.layui-rate li i.layui-icon{font-size:22px;}
	.layui-input-block{margin-left: 85px;}
</style> 
</head>
<body>
<div id="page" class="showpage" style="background: #fff;">
<header id="header"> 
<!-- <a href="{:U('Goods/categoryList')}" class="top_bt"></a><a href="{:U('Cart/cart')}" class='user_btn'></a> -->
<span href="javascript:void(0)" class="logo">众创织梦投诉建议！</span>
</header>

<div class="entry-list clearfix" style="width:95%;margin: auto;font-size:15px;">
<form class="layui-form" action="" style="height:570px;margin-top: 30px;" lay-filter="example">
  <div class="layui-form-item">
    <label class="layui-form-label">对象：</label>
    <div class="layui-input-block">
      <select name="interest" lay-filter="duixiang" name="duixiang">
		  <option value="">选择投诉对象</option>
		<?php
		  foreach($duixiang['kehu'] as $v){
		  ?>
        <option value="客服{$v['user_name']}">客服{$v['user_name']}</option>
		<?php
		}
		?>
		<?php
		  foreach($duixiang['siji'] as $v){
		  ?>
        <option value="司机{$v['user_name']}">司机{$v['user_name']}</option>
		<?php
		}
		?>
      </select>
    </div>
  </div>
  <input type="hidden" name="user_id" value="{$user['user_id']}"/>
  <div class="layui-form-item">
    <label class="layui-form-label">评分：</label>
    <div class="layui-input-block">
      <div id="pingfen"></div>
	  <input type="hidden" name="pingfen" id="pf" value="2"/>
    </div>
  </div>
  <div class="layui-form-item layui-form-text">
    <label class="layui-form-label">内容：</label>
    <div class="layui-input-block">
      <textarea placeholder="请输入内容" class="layui-textarea" name="beizhu"></textarea>
    </div>
  </div>
  <div class="layui-form-item">
    <div class="layui-input-block">
      <button type="button" class="layui-btn" id="LAY-component-form-getval">立即提交</button>
      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
  </div>
</form>
</div>
</div>
<script type="text/javascript">
    layui.use(['form', 'layedit', 'laydate','layer','rate'], function () {
      var form = layui.form,layer = layui.layer,layedit = layui.layedit,rate = layui.rate,laydate = layui.laydate,$ = layui.jquery;
		
  //基础效果
  rate.render({
    elem: '#pingfen'
    ,value: 2 //初始值
    ,text: true //开启文本
	,choose: function(value){
	    $('#pf').val(value);
	  }
  });
  
    layui.$('#LAY-component-form-getval').on('click', function(){
      var data = form.val('example');
	  if(data.interest==''){
		  layer.msg('请选择投诉对象！', {icon: 5});
		  return false;
	  }
	  if(data.beizhu==''){
		  layer.msg('请填写投诉内容！', {icon: 5});
		  return false;
	  }
	  $.post('/index.php/Mobile/Index/index.html',{
		  action:'yes',
		  user_id:data.user_id,
		  pingfen:data.pingfen,
		  duixiang:data.interest,
		  beizhu:data.beizhu
	  },function(res){
		  res=JSON.parse(res);
		if(res.code=='200'){
			layer.msg(res.msg, {icon: 6},function(){
				location.reload();
			});
		}else{
			layer.msg(res.msg, {icon: 5});
		}
	  });
    });

});
</script>
</body>
</html>